package com.demo.rocketmq.config;

/**
 * @author wangfengchen
 */
public enum RocketMqDelayLevelEnum {
  time1s(1),
  time5s(2),
  time10s(3),
  time30s(4),
  time1M(5),
  time2m(6),
  time3m(7),
  time4m(8),
  time5m(9),
  time6m(10),
  time7m(11),
  time8m(12),
  time9m(13),
  time10m(14),
  time20m(15),
  time30m(16),
  time1h(17),
  time2n(18);
  
  private int level;
  
  public int getLevel() {
    return this.level;
  }
  
  public void setLevel(int level) {
    this.level = level;
  }
  
  RocketMqDelayLevelEnum(int level) {
    this.level = level;
  }
  
  public static RocketMqDelayLevelEnum getByLevel(int level) {
    for (RocketMqDelayLevelEnum delayLevelEnum : values()) {
      if (delayLevelEnum.getLevel() == level)
        return delayLevelEnum; 
    } 
    return null;
  }
}
